<template>
  <el-row>
      <bar-chart :chart-data="chartData" />
  </el-row>
</template>

<script>
  import BarChart from '@/views/dashboard/BarChart_v1'
  import {getProList} from "@/api/sl/rwork";


export default {
  name: 'Chart',
  components: {
    BarChart
  },
  data() {
    return {
      chartData:null,
    }
  },
  created() {
    // this.fngetYearData();
  },
  methods: {
    // fngetYearData(){
    //   const currentDate = new Date();
    //   let arrYear = ['product', (currentDate.getFullYear() - 2).toString(), (currentDate.getFullYear() - 1)
    //     .toString(), (currentDate.getFullYear()).toString()
    //   ];
    //   let xm = ["鞋面", 0, 0, 0];
    //   let sf = ["沙发", 0, 0, 0];
    //   let sc = ["水场", 0, 0, 0];

    //   let obj = {};
    //   obj.date = currentDate;
    //   obj.strType = "module";
    //   getProList(obj).then(response => {
    //     console.log(response)

    //     response.data.forEach(item => {
    //       if (item.proDate == (currentDate.getFullYear() - 2)) {
    //         if (item.moduleId == 1) {
    //           xm[1] = item.production;
    //         } else if (item.moduleId == 2) {
    //           sf[1] = item.production;
    //         } else if (item.moduleId == 3) {
    //           sc[1] = item.production;
    //         }
    //       } else if (item.proDate == (currentDate.getFullYear() - 1)) {
    //         if (item.moduleId == 1) {
    //           xm[2] = item.production;
    //         } else if (item.moduleId == 2) {
    //           sf[2] = item.production;
    //         } else if (item.moduleId == 3) {
    //           sc[2] = item.production;
    //         }
    //       } else if (item.proDate == currentDate.getFullYear()) {
    //         if (item.moduleId == 1) {
    //           xm[3] = item.production;
    //         } else if (item.moduleId == 2) {
    //           sf[3] = item.production;
    //         } else if (item.moduleId == 3) {
    //           sc[3] = item.production;
    //         }
    //       }
    //     })
    //     this.chartData = {};
    //     this.chartData.arrYear = arrYear
    //     this.chartData.xm = xm
    //     this.chartData.sf = sf
    //     this.chartData.sc = sc
    //   })

    // }
  }
}
</script>

<style lang="scss" scoped>
.dashboard-editor-container {
  padding: 32px;
  background-color: rgb(240, 242, 245);
  position: relative;

  .chart-wrapper {
    background: #fff;
    padding: 16px 16px 0;
    margin-bottom: 32px;
  }
}

@media (max-width:1024px) {
  .chart-wrapper {
    padding: 8px;
  }
}
</style>
